﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace DARE.Save.DataStructures
{
    public class CLineText3DData : CSprite3DData
    {
        public string SpriteFont;
        public Color BackgroundColor;
        public string Text;


        public override void FillDataStructure(object spr3D)
        {
            base.FillDataStructure(spr3D);
            CLineText3D lt3D = spr3D as CLineText3D;
            if (lt3D == null)
                return;
            Text = lt3D.Text;
            SpriteFont = CResourceMgr.GetResourceName(lt3D.SpriteFont);
            BackgroundColor = lt3D.BackgroundColor;
        }

        public override void FillFromDataStructure(out object sprite3D, params object[] paramsData)
        {
            base.FillFromDataStructure(out sprite3D, paramsData);
            CLineText3D lt = sprite3D as CLineText3D;

            lt.SpriteFont = CResourceMgr.Load<Microsoft.Xna.Framework.Graphics.SpriteFont>(SpriteFont);
            lt.BackgroundColor = BackgroundColor;
            lt.Text = Text;
        }

        public override CSprite3D CreateInstance()
        {
            return new CLineText3D();
        }
    }
}
